<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<link rel="canonical" href="http://www.jointjs.com/" />
<link rel="stylesheet" href="<c:url value='/css/joint.all.css'/>" />
<link rel="stylesheet" href="<c:url value='/css/edit_aadl.css'/>" />
<script type="text/javascript">
	function goback() {
		history.go(-1);
	}
</script>
<div class="page-header">
	<h3 style="margin-top: auto">
	<c:choose>
		<c:when test="${!empty aadlTemplate}">
			系统架构模板:<a href="javascript:void(0);"><c:out value="${aadlTemplate.name}"></c:out></a>
		</c:when>
		<c:otherwise>
			系统架构实例
		</c:otherwise>
	</c:choose>
	<%-- <c:if test="${!empty aadlTemplate}"> --%>
	 <button class="btn btn-small" style="float: right;margin-right:30px;margin-top:10px;"
			onclick="goback()"><i class="icon-arrow-left"></i>&nbsp;返回</button></h3>
	<%-- </c:if> --%>
</div>
<div class="row-fluid">
	<c:if test="${!empty aadlTemplate}">
		<div class="form-horizontal">
			<p><strong>名称:</strong>${aadlTemplate.name}</p>
			<p><strong>描述信息:</strong>${aadlTemplate.description}</p>
		</div>
	</c:if>
	<c:if test="${!empty logerList}">
	<div class="accordion" id="accordion2">
  		<div class="accordion-group">
    		<div class="accordion-heading">
      			<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne">
        			更新日志
      			</a>
    		</div>
    		<div id="collapseOne" class="accordion-body collapse in">
      			<div class="accordion-inner">
        			<c:forEach items="${logerList}" var="loger" varStatus="s">
								<c:out value="${s.count}" />、
								&nbsp;时间：<c:out value="${1900+loger.time.getYear()}" />-<c:out value="${1+loger.time.getMonth()}" />-<c:out value="${1+loger.time.getDay()}" />
								&nbsp;更新者：<c:out value="${loger.operator.realname}" />
								<br/>
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;日志内容：<c:out value="${loger.logInfo}" />
								<br/>
					</c:forEach>
      			</div>
    		</div>
  		</div>
	</div>
	</c:if>
	<div class="tabbable"> <!-- Only required for left/right tabs -->
  		<ul class="nav nav-tabs">
    		<li class="active"><a href="#tab1" data-toggle="tab">架构图</a></li>
    		<li><a href="#tab2" data-toggle="tab">AADL</a></li>
  		</ul>
  		<div class="tab-content">
    		<div class="tab-pane active" id="tab1">
      			<div id="org" class="content-container">
					<div id="paper" class="paper"></div>
				</div>
    		</div>
    		<div class="tab-pane" id="tab2">
    		<c:set var="muri" value="${fn:replace(uri,':', '/')}" />
    		<Button class="btn" style="float:right"
				onclick="window.location.href='<%=request.getContextPath()%>/${muri}/aadl/download';"><i class="icon-download"></i>&nbsp;下载AADL代码</Button>
      			<pre style="height: 100%" ><c:out value="${code}" /></pre>
    		</div>
  		</div>
	</div>
</div>
</div>
<!--/span-->
<script src="js/joint.all.js"></script>
<script src="js/joint.shapes.devs.js"></script>
<script src="js/cdsf_map.js"></script>
<script src="js/addl_detail.js"></script>
<script src="js/edit_aadl.js"></script>
<script type="text/javascript">
	var nodeJson = ${nodeJson};
	var linkJson = ${linkJson};
	var width = ${width};
	var height = ${height};
	parsePaper(width,height);
	parseNode(nodeJson);
	parseLink(linkJson);
</script>